﻿{extend name="public:base" /}{block name="css"}
<link href="/static/laydate/theme/default/laydate.css">
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <a href="{:url('doManager')}" class="btn btn-primary btn-lg">新增</a>

                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="iconfont icon-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <select class="form-control" name="user_type">
                                <option value="0">请选择类型</option>
                                <option value="1" {:input('user_type') == 1 ? 'selected' : ''}>管理员</option>
                                <option value="2" {:input('user_type') == 2 ? 'selected' : ''}>推广员</option>
                            </select>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group" style="width: 100%; display: flex; justify-content: space-between">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>账号</th>
                                <th>推广码</th>
                                <th>类型</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.username}</td>
                                <td>{$vo.account}</td>
                                <td>{$vo.code}</td>
                                <td>{$vo.user_type == 1 ? '管理员' : '推广员'}</td>
                                <td>{$vo.status == 1 ? '启用' : '禁用'}</td>
                                <td class="project-actions">
                                    {if $vo.status == 1}
                                    <a href="{:url(doManagerStatus, ['id' => $vo.id, 'status' => 2])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-refuse"></i> 禁用 </a>
                                    {else /}
                                    <a href="{:url(doManagerStatus, ['id' => $vo.id, 'status' => 1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-success"></i> 启用 </a>
                                    {/if}
                                    <a href="{:url(initPwd, ['id' => $vo.id])}" data-msg="您确认重置密码为123456吗？" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-zhongxinhuida"></i> 重置密码 </a>
                                    <a href="{:url(doManager, ['id' => $vo.id])}" class="btn btn-white btn-sm"><i class="iconfont icon-edit"></i> 编辑 </a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/preview-img-mask" swiper-id="cropper-preview" /}
{/block}

{block name="js"}
<script src="/static/laydate/laydate.js"></script>
{/block}
